package org.plex.task.imp;

import java.io.Serializable;
import java.util.List;

import org.plex.core.imp.TaskACLImp;
import org.plex.model.TaskACL;
import org.plex.task.CreateTaskInfo;
import org.plex.task.FormInstance;
import org.plex.task.TaskTimerInfo;

import com.adobe.idp.taskmanager.dsc.client.task.FormInstanceImpl;
import com.adobe.idp.taskmanager.dsc.client.task.TaskACLImpl;

public class CreateTaskInfoImp implements CreateTaskInfo,Serializable{

	private static final long serialVersionUID = -8358377493175076686L;
    private com.adobe.idp.taskmanager.dsc.client.task.CreateTaskInfo createTaskInfo;
	
    public CreateTaskInfoImp(com.adobe.idp.taskmanager.dsc.client.task.CreateTaskInfo createTaskInfo)throws NullPointerException
    {
       if(null==createTaskInfo)
       {
    	   throw new NullPointerException();
       }
       this.createTaskInfo=createTaskInfo;
    }
    
    
	public void addACLsForSharedQueues(boolean isAddACLsForSharedQueues) {
		// TODO Auto-generated method stub
		this.createTaskInfo.addACLsForSharedQueues(isAddACLsForSharedQueues);
	}

	@Deprecated
	public void copyAttachments(boolean isCopyAttachments) {
		// TODO Auto-generated method stub
		this.createTaskInfo.copyAttachments(isCopyAttachments);
	}

	public void isStartTask(boolean isStartTask) {
		// TODO Auto-generated method stub
		this.createTaskInfo.isStartTask(isStartTask);
	}

	public void setActionId(long actionId) {
	  this.createTaskInfo.setActionId(actionId);
		
	}

	public void setAssignTo(org.plex.task.ParticipantInfo participantInfo) {
		ParticipantInfoImp imp=(ParticipantInfoImp)participantInfo;
		this.createTaskInfo.setAssignTo(imp.getParticipantInfo());
	}

	public void setAttachmentDocumentList(List attachmentDocumentList) {
		this.createTaskInfo.setAttachmentDocumentList(attachmentDocumentList);
	}

	public void setDeadlineInfo(TaskTimerInfo taskTimerInfo) {
		TaskTimerInfoImp imp=(TaskTimerInfoImp)taskTimerInfo;
		this.createTaskInfo.setDeadlineInfo(imp.getTaskTimerInfo());
	}

	public void setDeadlineInstructions(String instructions) {
	  this.createTaskInfo.setDeadlineInstructions(instructions);
	}

	public void setDeadlineRouteName(String routeName) {
		// TODO Auto-generated method stub
     this.createTaskInfo.setDeadlineRouteName(routeName);		
	}

	public void setDecription(String description) {
		this.createTaskInfo.setDescription(description);
		
	}

	public void setDefaultACLs(TaskACL taskACL) {
	  TaskACLImp imp=(TaskACLImp)taskACL;
	  this.createTaskInfo.setDefaultACLs(imp.getTaskACL());	
	}

	public void setEscalateTo(org.plex.task.ParticipantInfo participantInfo) {
		// TODO Auto-generated method stub
		ParticipantInfoImp imp=(ParticipantInfoImp)participantInfo;
		this.createTaskInfo.setEscalateTo(imp.getParticipantInfo());
	}

	public void setEscalationInfo(TaskTimerInfo taskTimerInfo) {
		// TODO Auto-generated method stub
		TaskTimerInfoImp imp=(TaskTimerInfoImp)taskTimerInfo;
		this.createTaskInfo.setEscalationInfo(imp.getTaskTimerInfo());
	}

	public void setFirstReminderInfo(TaskTimerInfo taskTimerInfo) {
		// TODO Auto-generated method stub
		TaskTimerInfoImp imp=(TaskTimerInfoImp)taskTimerInfo;
		this.createTaskInfo.setFirstReminderInfo(imp.getTaskTimerInfo());
	}

	public void setForwardGroup(String services, String groupName) {
		this.createTaskInfo.setForwardGroup(services, groupName);	
	}

	public void setForwardGroupId(String forwardGroupId) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setForwardGroupId(forwardGroupId);
	}

	public void setInstructions(String instructions) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setInstructions(instructions);
	}

	public void setLongLivedInvocationId(String longLivedInvocationId) {
         this.createTaskInfo.setLongLivedInvocationId(longLivedInvocationId);	
	}

	public void setOutOfOfficeEligible(boolean isOutofOffice) {
		this.createTaskInfo.setOutOfOfficeEligible(isOutofOffice);
	}

	public void setOutOfOfficeEligibleEscalations(
			boolean isOutOfOfficeEligibleEscalations) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setOutOfOfficeEligibleEscalations(isOutOfOfficeEligibleEscalations);
	}

	public void setPriority(short priority) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setPriority(priority);
	}

	public void setProcessInstanceId(long processInstanceId) {
		// TODO Auto-generated method stub
       this.createTaskInfo.setProcessInstanceId(processInstanceId);
	}

	public void setProcessName(String processName) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setProcessName(processName);
	}

	public void setReminderInstructions(String reminderInstructions) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setReminderInstructions(reminderInstructions);
	}

	@Deprecated
	public void setReminderRepeatMinutes(long reminderRepeatMinutes) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setReminderRepeatMinutes(reminderRepeatMinutes);
	}

	public void setRepeatReminderInfo(TaskTimerInfo taskTimerInfo) {
		// TODO Auto-generated method stub
		TaskTimerInfoImp imp=(TaskTimerInfoImp)taskTimerInfo;
		this.createTaskInfo.setRepeatReminderInfo(imp.getTaskTimerInfo());
	}

	public void setRouteList(List<String> routeList) {
		// TODO Auto-generated method stub
		int size=routeList.size();
		String[] strings=new String[size];
		for(int i=0;i<size;i++)
		{
			strings[i]=routeList.get(i);
		}
		this.createTaskInfo.setRouteList(strings);
	}

	public void setRouteSelectionRequired(boolean isRequired) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setRouteSelectionRequired(isRequired);
	}

	public void setSelectedRoute(String selectedRoute) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setSelectedRoute(selectedRoute);
	}

	public void setStepName(String stepName) {
		// TODO Auto-generated method stub
		this.createTaskInfo.setStepName(stepName);
	}

	public void setTaskACLs(List<TaskACL> taskACLList) {
		int size=taskACLList.size();
		com.adobe.idp.taskmanager.dsc.client.task.TaskACL[] imp=new TaskACLImpl[size];
		for(int i=0;i<size;i++)
		{
		  TaskACLImp im=(TaskACLImp)taskACLList.get(i); 
		  imp[i]=im.getTaskACL();
		}
		
		this.createTaskInfo.setTaskACLs(imp);
	}

	public void setTaskItems(List<? extends FormInstance> FormInstanceList) {
	    int size=FormInstanceList.size();
	    com.adobe.idp.taskmanager.dsc.client.task.FormInstance[] formInstances=new FormInstanceImpl[size];
	    for(int i=0;i<size;i++)
	    {
	       FormInstanceImp imp=(FormInstanceImp)FormInstanceList.get(i);
	       formInstances[i]=imp.getFormInstance();
	    }
		this.createTaskInfo.setTaskItems(formInstances);
	}

	public void showAttachments(boolean isShowAttachments) {
		// TODO Auto-generated method stub
        this.createTaskInfo.showAttachments(isShowAttachments);		
	}

	public void setCreateTaskInfo(com.adobe.idp.taskmanager.dsc.client.task.CreateTaskInfo createTaskInfo) {
		this.createTaskInfo = createTaskInfo;
	}

	public com.adobe.idp.taskmanager.dsc.client.task.CreateTaskInfo getCreateTaskInfo() {
		return createTaskInfo;
	}
	

}
